home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form CircleForm
- Caption = "Circle 1"
- ClientHeight = 5310
- ClientLeft = 2175
- ClientTop = 930
- ClientWidth = 4830
- Height = 6000
- Left = 2115
- LinkTopic = "Form1"
- ScaleHeight = 354
- ScaleMode = 3 'Pixel
- ScaleWidth = 322
- Top = 300
- Width = 4950
- Begin VB.TextBox DtText
- Height = 285
- Left = 2160
- TabIndex = 6
- Text = "0.1"
- Top = 45
- Width = 615
- End
- Begin VB.TextBox TminText
- Height = 285
- Left = 0
- TabIndex = 4
- Text = "0"
- Top = 45
- Width = 615
- End
- Begin VB.CommandButton CmdGo
- Caption = "Go"
- Default = -1 'True
- Height = 375
- Left = 4200
- TabIndex = 3
- Top = 0
- Width = 615
- End
- Begin VB.TextBox TmaxText
- Height = 285
- Left = 1200
- TabIndex = 2
- Text = "6.2832"
- Top = 45
- Width = 615
- End
- Begin VB.PictureBox Canvas
- AutoRedraw = -1 'True
- Height = 4815
- Left = 0
- ScaleHeight = -2.2
- ScaleLeft = -1.1
- ScaleMode = 0 'User
- ScaleTop = 1.1
- ScaleWidth = 2.2
- TabIndex = 0
- Top = 480
- Width = 4815
- End
- Begin VB.Label Label1
- Caption = "dt"
- Height = 255
- Index = 1
- Left = 1920
- TabIndex = 5
- Top = 60
- Width = 255
- End
- Begin VB.Label Label1
- Caption = "<= t <="
- Height = 255
- Index = 0
- Left = 645
- TabIndex = 1
- Top = 60
- Width = 495
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileExit
- Caption = "E&xit"
- End
- End
- Attribute VB_Name = "CircleForm"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Const PI = 3.14159
- ' ************************************************
- ' Draw the curve on the indicated picture box.
- ' ************************************************
- Sub DrawCurve(pic As PictureBox, start_t As Single, stop_t As Single, dt As Single)
- Dim x1 As Single
- Dim y1 As Single
- Dim t As Single
- x1 = X(start_t)
- y1 = Y(start_t)
- pic.Cls
- pic.CurrentX = x1
- pic.CurrentY = y1
- t = start_t + dt
- Do While t < stop_t
- x1 = X(t)
- y1 = Y(t)
- pic.Line -(x1, y1)
- t = t + dt
- Loop
- x1 = X(stop_t)
- y1 = Y(stop_t)
- pic.Line -(x1, y1)
- End Sub
- ' ************************************************
- ' The parametric function Y(t).
- ' ************************************************
- Function Y(t As Single) As Single
- Y = Sin(t)
- End Function
- ' ************************************************
- ' The parametric function X(t).
- ' ************************************************
- Function X(t As Single) As Single
- X = Cos(t)
- End Function
- Private Sub CmdGo_Click()
- Dim tmin As Single
- Dim tmax As Single
- Dim dt As Single
- tmin = CSng(TminText.Text)
- tmax = CSng(TmaxText.Text)
- dt = CSng(DtText.Text)
- DrawCurve Canvas, tmin, tmax, dt
- End Sub
- Private Sub mnuFileExit_Click()
- Unload Me
- End Sub
-